<div class="fcj_menu">
     <b class="spbg2 corner tl"></b>
     <b class="spbg2 corner tr"></b>
     <b class="spbg2 corner bl"></b>
     <b class="spbg2 corner br"></b> 
     <br/>   
     <table class="list" border="1" cellpadding="0" cellspacing="0" bordercolor="#b9b9b9" style="border-collapse:collapse">
	    <tr class="topic">
	    	<td width="100" style="text-align: right; padding-right: 5px;"><b>NO.:</b></td>
	    	<td style="text-align: left; padding-left: 5px;">G<?=$this->orderArray[0]['orderid']?></td>	    	
	    </tr>
	    <tr class="topic">
	    	<td style="text-align: right; padding-right: 5px;"><b>Add Time:<br />Pay Time: <br />Shipped Time:</b></td>
	    	<td style="text-align: left; padding-left: 5px;">
		    	<?=date('Y-m-d H:i:s',$this->orderArray[0]['add_time'])?>
			  <br />
			  <?if($this->orderArray[0]['pay_time']!='0'):?>
			  	<?=date('Y-m-d H:i:s',$this->orderArray[0]['pay_time'])?>
			  <?else:?>
			  	Not yet paid
			  <?endif;?>
			  <br />
			  <?if($this->orderArray[0]['ship_time']!='0'):?>
			  	<?=date('Y-m-d H:i:s',$this->orderArray[0]['ship_time'])?>
			  <?else:?>
			  	Not yet shipped
			  <?endif;?>
	    	</td>	    	
	    </tr> 
	    <tr class="topic">
	    	<td style="text-align: right; padding-right: 5px;"><b>Seller:</b></td>
	    	<td style="text-align: left; padding-left: 5px;"><?=$this->orderArray[0]['seller_name']?></td>	    	
	    </tr> 
	    <tr class="topic">
	    	<td style="text-align: right; padding-right: 5px;"><b>Total:</b></td>
	    	<td style="text-align: left; padding-left: 5px;">
	    		Total Cost: $<?php echo $this->orderArray[0]['money'];?>
			  	<br />Express total：$<?=$this->orderArray[0]['yunfeiprice']?> 
			  	<!-- <br />Domestic express total：$<?=$this->orderArray[0]['domestic_shipping_cost']?>
			  	<br />International total：$<?=$this->orderArray[0]['shipping_cost']-$this->orderArray[0]['domestic_shipping_cost']?> -->
	    	</td>	    	
	    </tr> 
	    <tr class="topic">
	    	<td style="text-align: right; padding-right: 5px;"><b>Status:</b></td>
	    	<td style="text-align: left; padding-left: 5px;">
	    		<?=$this->orderArray[0]['en_flname']?>
	    		<?php if ($this->orderArray[0]['flid'] >= 4):?>
	    			<?php echo ',Order Number:' . $this->orderArray[0]['sendid'];?>
	    		<?php endif;?>
				<?if(count($this->reimburseAccountArray)==0):?>
					<?if($this->orderArray[0]['flid']=='6'):?>
						<div style="position:relative;"><!-- <input type="button" class="subtn spbg2" value="Require reimbursement" onclick="showAccount.show(this);" />&nbsp; --><input type="button" class="subtn spbg2" value="Cancel dispute" onclick="orderRemark.flid='3';orderRemark.orderid='<?=$this->orderArray[0]['orderid']?>';orderRemark.orderflid='6';orderRemark.message='Why do you cancel dispute?';orderRemark.show(this);" /></div>
					<?endif;?>
				<?else:?>
					<div style="position:relative;">
						<?if($this->reimburseAccountArray[0]['state']=='0'):?>
							<font color="red">&nbsp;&nbsp;Has Submited Reimbursement</font>&nbsp;&nbsp;
						<?else:?>
							<font color="red">&nbsp;&nbsp;Has Reimbursement</font>&nbsp;&nbsp;
						<?endif;?>
						<?if($this->orderArray[0]['flid']=='6'):?>
						<input class="subtn spbg2" value="Cancel reimbursement" onclick="orderRemark.flid='4';orderRemark.orderid='<?=$this->orderArray[0]['orderid']?>';orderRemark.orderflid='6';orderRemark.message='Why do you cancel reimbursement?';orderRemark.show(this);" type="button" />
						<?endif;?>
					</div>
				<?endif;?>
				<?if($this->orderArray[0]['flid']=='5'):?>					
					<div style="position:relative;">
						<input type="button"  class="subtn spbg2" value="Cancel this order" onclick="orderRemark.flid='1';orderRemark.orderid='<?=$this->orderArray[0]['orderid']?>';orderRemark.orderflid='6';orderRemark.message='Why do you cancel this order?';orderRemark.show(this);" />&nbsp;&nbsp;
					</div>
				<?endif;?>
	    	
	    	</td>	    	
	    </tr>
	    <?if(count($this->orderDelayArray)>0):?>
		<tr class="topic">
	      <td style="text-align: right; padding-right: 5px;"> Extend the delivery time：</td>
	      <td style="text-align: left; padding-left: 5px;">
		  	<div><strong>Reason：</strong><?=$this->orderDelayArray[0]['content']?></div>
			<div><strong>Delayed Days： </strong><?=$this->orderDelayArray[0]['delay_days']?></div>
			<div><strong>Through the application？ </strong><?if($this->orderDelayArray[0]['has_approved']=='1'):?>Yes<?elseif($this->orderDelayArray[0]['has_approved']=='2'):?>No<?else:?>Not reviewed<?endif;?></div>
			<div>
				<?if($this->orderDelayArray[0]['has_approved']=='0'):?>
					<input type="button" onclick="approveOrder('0');" value="Not pass the application " />&nbsp;&nbsp;<input type="button" onclick="approveOrder('1');" value="Pass the application" />
				<?endif;?>
			</div>
		  </td>
	    </tr>
		<?endif;?>
	   <!-- <tr class="topic">
	    	<td style="text-align: right; padding-right: 5px;"><b>Payment:</b></td>
	    	<td style="text-align: left; padding-left: 5px;">
	    		<strong><?=$this->orderArray[0]['payment']?></strong>
				<?=$this->getPayment($this->orderArray[0]['payment']);?>
	    	</td>	    	
	    </tr> --> 
	    <tr class="topic">
	    	<td style="text-align: right; padding-right: 5px;"><b>Items:</b></td>
	    	<td style="text-align: left; padding-left: 5px;">
	    	<?foreach($this->itemArray as $value):?>
			<div class="orderItemsDiv">
				<div class="orderItemsLeft"><a target="_blank" href="<?=MY_URL?>/pd-<?=$value['itemid']?>.html"><img src="<?=$value['cut_url']?>" /></a></div>
				<div class="orderItemsRight">
					<div>Item Name: <?=$value['subject']?></div>
					<div>Price: <?=$this->numberFormat($value['net_price'],2)?></div>
					<div>Amounts: <?=$value['amounts']?></div>
					<div>Total: <?=$this->numberFormat($value['amounts']*$value['net_price'],2)?>　<!-- Shipping Total:<?=$this->numberFormat($value['item_shipping_cost'],2)?> --></div>
					<div>Pattern size：<?=$value['buy_pattern_size']?></div>
					<div>Badge Patch：<?=$value['buy_BadgePatch']?></div>
                                        <div>Print：<?=$value['buy_name_num']?></div>
					<div>Print amounts：<?=$value['printAmounts']?></div>
					<div>Message：<?=$value['printMesg']?></div>
					<div>
						<!--Carrier: <?=$this->getCarrierCompany($value['carrier'],'company_name');?>　　
						<?if($this->orderArray[0]['flid']!='1'&&$this->orderArray[0]['flid']!='2'&&$this->orderArray[0]['flid']!='7'&&$this->orderArray[0]['flid']!='8'):?>
							<input id="itemInput<?=$value['itemid']?>" type="button" onclick="parent.orderExpress.orderid='<?=$this->orderArray[0]['orderid']?>';parent.orderExpress.itemid='<?=$value['itemid']?>';parent.orderExpress.shipping_cost='<?=$this->numberFormat($value['amounts']*$value['item_shipping_cost'],2)?>';parent.orderExpress.mode='express';parent.orderExpress.show()" value="Shipping Info" />
						<?elseif($this->orderArray[0]['flid']=='1'):?>
							<input disabled type="button" value="Shipping Info" />
						<?endif;?>-->
					</div>
					<?php if ($this->orderArray[0]['flid'] == 9):?>
					<div>
						<?php $row = $this->productReview->isExist($value['itemid'], $_COOKIE[COOKIE_PRE . 'uid'], $this->orderArray[0]['orderid']);?>
						<?php if (count($row) <= 0):?>
							<input class="subtn spbg2" onclick="parent.addComment.orderid=<?php echo $this->orderArray[0]['orderid']?>;parent.addComment.itemid=<?php echo $value['itemid'];?>;parent.addComment.show();" type="button" value="Add Review For This Product" />
						<?php else:?>
							<br/>
							My Review: Quality Score(<?php echo $row->current()->product_score?>), Ship Score(<?php echo $row->current()->ship_score;?>), Overall Score(<?php echo $row->current()->overall_score;?>)<br/>
							Comment: <?php echo $row->current()->comments;?>
						<?php endif;?>
					</div>
					<?php endif;?>
				</div>
				<br/>
				<div class="clear"></div>
			</div>
		<?endforeach;?>
	    	
	    	</td>	    	
	    </tr>
	    <tr class="topic">
	    	<td style="text-align: right; padding-right: 5px;"><b>Remark:</b></td>
	    	<td style="text-align: left; padding-left: 5px;">
	    		<?php echo $this->orderArray[0]['msg'];?>
	    	</td>	    	
	    </tr>	
	    <tr class="topic">
	    	<td style="text-align: right; padding-right: 5px;"><b>Shipping Info:</b></td>
	    	<td style="text-align: left; padding-left: 5px;">
	    		Name: <?php echo $this->contact->name;?><br/>
	    		Phone: <?php echo $this->contact->phone;?><br/>
	    		City: <?php echo $this->contact->city;?><br/>
	    		Postcode: <?php echo $this->contact->post_code;?><br/>
	    		Address: <?php echo $this->contact->content;?>
	    	</td>	    	
	    </tr>	    
		<?if($this->disputeRemarkArray[0]['content']!=''):?>
		<tr>
	      <td style="text-align: right; padding-right: 5px;"><b>Reason of dispute:</b></td>
	      <td style="text-align: left; padding-left: 5px;"><?=$this->disputeRemarkArray[0]['content']?></td>
	    </tr>
		<?endif;?>
		<?if($this->reimburseRemarkArray[0]['content']!=''):?>
		<tr>
	      <td style="text-align: right; padding-right: 5px;"><b>Reason of reimbursement:</b></td>
	      <td style="text-align: left; padding-left: 5px;"><?=$this->reimburseRemarkArray[0]['content']?> <a href="adminb-account-more?accountid=<?=$this->reimburseAccountArray[0]['accountid']?>&flid=5">Check this account</a></td>
	    </tr>
		<?endif;?>
		<?if($this->cancelDisputeRemarkArray[0]['content']!=''):?>
		<tr>
	      <td style="text-align: right; padding-right: 5px;"><b>Reason of canceling dispute:</b></td>
	      <td style="text-align: left; padding-left: 5px;"><?=$this->cancelDisputeRemarkArray[0]['content']?></td>
	    </tr>
		<?endif;?>
		<?if($this->cancelReimbursementArray[0]['content']!=''):?>
		<tr>
	      <td style="text-align: right; padding-right: 5px;"><b>Reason of canceling reimbursement:</b></td>
	      <td style="text-align: left; padding-left: 5px;"><?=$this->cancelReimbursementArray[0]['content']?></td>
	    </tr>
		<?endif;?>
	</table>
</div>
<script>
function confirmOrder(mode){
	if(mode=='yes'){
		$('#confirmentDiv').hide();
		$('#satisfiedDiv').fadeIn('slow');
	}else{
		alert("Please be patient, you will receive the items very soon!");
	}
}
function confirmSatisfied(mode){
	if(mode==1){
		if($($('input[name="satisfied"]').get(0)).attr('checked')==true){
			$('#orderMoreForm').submit();
		}else{
			if(confirm("Sure to set the state for “dispute”?")){
				$('input[name="isSatisfied"]').val(0);
				$('#orderMoreForm').submit();
			}
		}
	}else{
		$('#satisfiedDiv').hide();
		$('#confirmentDiv').fadeIn('slow');
	}
}
function reimburse(){
	if($('#paypalMethod').attr('checked')==true){
		if(!checkEmail($('input[name="paypal"]').val())){
			alert('Please input your paypal account!');
			return;
		}
	}
	if(confirm('Sure to require reimbursement?')){
		$('#orderMoreForm').attr('action','adminb-account-reimburse?orderid=<?=$this->orderArray[0]['orderid']?>');
		$('#orderMoreForm').submit();
	}
}

var showAccount={
	show:function(thisA){
		this.remove();
		$(thisA).parent().append("<div id='reimburseFloatDiv'></div>");
		$('#reimburseFloatDiv').css('position','absolute');
		$('#reimburseFloatDiv').css('left','0px');
		$('#reimburseFloatDiv').css('top','15px');
		$('#reimburseFloatDiv').css('border','1px solid #cccccc');
		$('#reimburseFloatDiv').css('padding','10px');
		$('#reimburseFloatDiv').css('backgroundColor','#F7F7F7');
		$('#reimburseFloatDiv').html('<img src="html/images/loading.gif" />');
		this.getContent();
	},
	getContent:function(){
		$.post(ROOT_PATH+"/adminb-order-getaccount",{},function(data) {
			$('#reimburseFloatDiv').html(data);
		});		
	},
	remove:function(){
		$('#reimburseFloatDiv').remove();	
	}
};
var orderRemark={
	flid:'0',
	orderid:'0',
	message:'Why do you cancel this order?',
	orderflid:'0',
	show:function(thisA){
		this.remove();
		$(thisA).parent().append("<div id='orderRemarkFloatDiv'></div>");
		$('#orderRemarkFloatDiv').css('position','absolute');
		$('#orderRemarkFloatDiv').css('left','0px');
		$('#orderRemarkFloatDiv').css('top','15px');
		$('#orderRemarkFloatDiv').css('border','1px solid #cccccc');
		$('#orderRemarkFloatDiv').css('padding','10px');
		$('#orderRemarkFloatDiv').css('backgroundColor','#F7F7F7');
		$('#orderRemarkFloatDiv').html('<img src="html/images/loading.gif" />');
		this.getContent();
	},
	getContent:function(){
		$.post(ROOT_PATH+"/adminb-order-orderremark",{flid:this.flid,orderid:this.orderid,message:this.message,orderflid:this.orderflid},function(data) {
			$('#orderRemarkFloatDiv').html(data);
		});
	},
	remove:function(){
		$('#orderRemarkFloatDiv').remove();	
	}
};
function approveOrder(type){
	if(type=='0'){
		if(!confirm("Determined not to apply?")){
			return false;
		}
		$('#orderMoreForm').attr('action','adminb-order-doapprove?has_approved=2&orderid=<?=$this->orderArray[0]['orderid']?>');
		$('#orderMoreForm').submit();
	}else if(type=='1'){
		if(!confirm("Determined to apply?")){
			return false;
		}
		$('#orderMoreForm').attr('action','adminb-order-doapprove?has_approved=1&orderid=<?=$this->orderArray[0]['orderid']?>');
		$('#orderMoreForm').submit();
	}
}
<?if(count($this->scoreArray)==0):?>
$('.score_no').mouseover(
	function(){
		fullFillScore($(this));
	}
);
$('.score_no').mouseout(
	function(){
		$(this).parent().find('a').attr('className','score_no');
		$(this).parent().find('label:last').html('');
	}
);
function fullFillScore(thisA){
	thisA.attr('className','score_yes');
	while(true){
		var thisA=$(thisA).prev();
		if(thisA.attr('className')!='score_no'){
			break;
		}else{
			thisA.attr('className','score_yes');
		}
	}
	var index=thisA.parent().find('.score_yes').length;
	thisA.parent().find('label:last').html('&nbsp;&nbsp;'+index+' Point(s)');
}
$('.score_no').click(
	function(){
		$(this).parent().find('a').attr('className','score_no');
		fullFillScore($(this));
		$(this).parent().find('a').unbind('mouseover');
		$(this).parent().find('a').unbind('mouseout');
		var index=$(this).parent().find('.score_yes').length;
		$(this).parent().find('label:last').html('&nbsp;&nbsp;'+index+' Point(s)');
		$(this).parent().find('input').val(index);
	}
);
function doscore(){
	var isTrue=true;
	$('.orderScore input').each(
		function(){
			if($(this).val()=='0'){
				isTrue=false;
				alert('Please score for this order!');
				return false;	
			}
		}
	);
	if(isTrue){
		$('#orderMoreForm').attr('action','adminb-score-doscore?&orderid=<?=$this->orderArray[0]['orderid']?>');
		$('#orderMoreForm').submit();
	}
}
<?endif;?>
</script>